from django.urls import path
from book.views import index,weibo,http_res,res_json,set_cookie,get_cookie,register
# 系统提供的一些路由转换器
from django.urls import converters
# 自定义转换器
class MobileConverter:
    regex = '1[3-9]\d{9}'
    def to_python(self,value):
        return value

from django.urls.converters import register_converter
register_converter(MobileConverter,'mm')


urlpatterns = [
    path('index/',index),

    # path('<pro_id>/<city_id>/',shop),

    path('weibo/',weibo),

    path('http_res/',http_res),

    path('res_json/',res_json),

    path('set_cookie/',set_cookie),

    path('get_cookie/',get_cookie),

    path('register/<mm:mobile>/',register),
]